home *** CD-ROM | disk | FTP | other *** search
- package Forms
- {
- import Common.SoundManager;
- import caurina.transitions.Tweener;
- import flash.display.DisplayObject;
- import flash.display.MovieClip;
- import flash.display.SimpleButton;
- import flash.events.MouseEvent;
- import flash.geom.ColorTransform;
- import flash.text.TextField;
-
- [Embed(source="/_assets/assets.swf", symbol="Forms.AchievementsForm")]
- public class AchievementsForm extends CluelessBaseForm
- {
-
-
- public var _mcAward0:Medal;
-
- public var _mcAward3:Medal;
-
- public var _mcAward4:Medal;
-
- internal var _iCurrentMedal:int = 0;
-
- public var _mcAward1:Medal;
-
- public var _mcAward2:Medal;
-
- internal var _aAchievements:Array;
-
- internal var _iTotalMedals:int;
-
- public var _tfAwardName:TextField;
-
- internal const MOVE_TIME:Number = 1;
-
- public var _tfAwardDescription:TextField;
-
- public var _bPrev:ArrowTriangle;
-
- public var _tfAwardStatus:TextField;
-
- public var _bNext:ArrowTriangle;
-
- internal var _aSlots:Array;
-
- public var _bExit:SimpleButton;
-
- internal const CENTER_SLOT:int = 2;
-
- public var _bMenu:ButtonRound;
-
- protected var _dragcontroller:DragController;
-
- internal const NUM_SLOTS:int = 5;
-
- public function AchievementsForm()
- {
- var _loc1_:int = 0;
- var _loc2_:Medal = null;
- var _loc3_:int = 0;
- var _loc4_:String = null;
- var _loc5_:DisplayObject = null;
- _dragcontroller = new DragController();
- _aSlots = new Array();
- _aAchievements = new Array();
- _iCurrentMedal = 0;
- super();
- _loc1_ = 0;
- while(_loc1_ < NUM_SLOTS)
- {
- _loc4_ = "_mcAward" + _loc1_;
- _loc5_ = getChildByName(_loc4_);
- _aSlots.push(_loc5_);
- _loc5_.visible = false;
- _loc1_++;
- }
- _bPrev.addEventListener(MouseEvent.CLICK,onPrev,false,0,true);
- _bNext.addEventListener(MouseEvent.CLICK,onNext,false,0,true);
- _loc2_ = new Medal();
- _iTotalMedals = _loc2_.totalFrames;
- _loc3_ = getChildIndex(_mcAward0);
- _loc1_ = 0;
- while(_loc1_ <= _iTotalMedals)
- {
- _loc2_ = new Medal();
- _loc2_.x = 0;
- _loc2_.y = 0;
- _loc2_.gotoAndStop(_loc1_);
- addChildAt(_loc2_,_loc3_);
- _aAchievements.push(_loc2_);
- _loc1_++;
- }
- setBackButton(_bExit);
- installMouseOverSound(_bExit);
- _iCurrentMedal = 0;
- showMedals(_iCurrentMedal,0);
- }
-
- internal function cleanupMedals() : void
- {
- var _loc1_:int = 0;
- var _loc2_:Medal = null;
- _loc1_ = 0;
- while(_loc1_ <= _iTotalMedals)
- {
- _loc2_ = _aAchievements[_loc1_];
- if(Profile.CurrentProfile.isAchievementUnlocked(_loc2_.currentLabel))
- {
- _loc2_.filters = null;
- _loc2_.transform.colorTransform = new ColorTransform();
- }
- else
- {
- _loc2_.filters = _mcAward1.filters;
- _loc2_.transform.colorTransform = _mcAward1.transform.colorTransform;
- }
- Tweener.removeTweens(_loc2_);
- _loc2_.visible = false;
- _loc1_++;
- }
- }
-
- override public function onFocus() : void
- {
- super.onFocus();
- if((Profile.CurrentProfile.TutorialMask & Profile.kTutorial_Honors) == 0)
- {
- setTutorial(new MCTutorialHonors());
- Profile.CurrentProfile.TutorialMask |= Profile.kTutorial_Honors;
- Storage.getInstance().saveProfiles();
- }
- }
-
- internal function getSlot(param1:int) : MovieClip
- {
- return _aSlots[param1] as MovieClip;
- }
-
- internal function onPrev(param1:MouseEvent) : void
- {
- --_iCurrentMedal;
- _iCurrentMedal = normalizeIndex(_iCurrentMedal);
- showMedals(_iCurrentMedal,1);
- SoundManager.getInstance().playSound("ScrollAwardsSound");
- }
-
- internal function onNext(param1:MouseEvent) : void
- {
- ++_iCurrentMedal;
- _iCurrentMedal = normalizeIndex(_iCurrentMedal);
- showMedals(_iCurrentMedal,-1);
- SoundManager.getInstance().playSound("ScrollAwardsSound");
- }
-
- internal function updateText(param1:String) : void
- {
- var _loc2_:String = null;
- var _loc3_:* = null;
- var _loc4_:* = null;
- _loc2_ = "";
- _loc3_ = "";
- _loc4_ = "";
- switch(param1)
- {
- case "asian flair":
- _loc2_ = "Asian Flair Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Asian Flair level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Asian Flair","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "beach":
- _loc2_ = "Beach Wear Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Beach Wear level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Beach","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "carpet":
- _loc2_ = "Red Carpet Ready Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Red Carpet level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Carpet","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "crown":
- _loc2_ = "Crown Award";
- _loc3_ = "Finish the game while using power-ups.";
- break;
- case "corporate":
- _loc2_ = "Corporate Style Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in Corporate Style level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Corporate","TotalOccasionGoodMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "club wear":
- _loc2_ = "Club Wear Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Club Wear level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Club Wear","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "david":
- _loc2_ = "David Award";
- _loc3_ = "Wow David " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("David","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "elton":
- _loc2_ = "Elton Award";
- _loc3_ = "Wow Elton " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Elton","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "power":
- _loc2_ = "Girl Power Award";
- _loc3_ = "Finish the game without using any power-ups.";
- break;
- case "formal":
- _loc2_ = "Formal Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Formal Wear level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Formal","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "golden":
- _loc2_ = "Golden Cher Award";
- _loc3_ = "Match all the girls with their respective partners.";
- break;
- case "grunge":
- _loc2_ = "L.A. Grunge Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a L.A. Grunge level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Grunge","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "gym":
- _loc2_ = "Gym Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a gym level.";
- break;
- case "halloween":
- _loc2_ = "Halloween Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a halloween level.";
- break;
- case "hip hop":
- _loc2_ = "90`s Hip Hop Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a 90\'s Hip Hop level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Hip Hop","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "hollywood":
- _loc2_ = "Vintage Hollywood";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Vintage Hollywood level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Hollywood","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "josh":
- _loc2_ = "Josh Award";
- _loc3_ = "Wow Josh " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Josh","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "lolita":
- _loc2_ = "Gothic Lolita Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Gothic Lolita level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Lolita","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "luke":
- _loc2_ = "Luke Award";
- _loc3_ = "Wow Luke " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Luke","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "military":
- _loc2_ = "Military Chic Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Military Chic level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Military","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "murray":
- _loc2_ = "Murray Award";
- _loc3_ = "Wow Murray " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Murray","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "nature":
- _loc2_ = "Nature Girl Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Nature Girl level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Nature","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "preppy":
- _loc2_ = "Beverly Hills Preppy";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Beverly Hills Preppy level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Preppy","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "prom":
- _loc2_ = "Prom Perfect Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Prom Perfect level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Prom","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "rodeo":
- _loc2_ = "Rodeo Drive Rodeo";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches for Rodeo Drive Rodeo level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Rodeo","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "sean":
- _loc2_ = "Sean Award";
- _loc3_ = "Wow Sean " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Sean","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "slumber":
- _loc2_ = "Slumber Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a slumber party level.";
- break;
- case "sporty":
- _loc2_ = "Sporty Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a Sporty level.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Sporty","TotalOccasionGoodMatches") + " of " + AchievementsList.OCCASION_MATCH_NUM;
- break;
- case "travis":
- _loc2_ = "Travis Award";
- _loc3_ = "Wow Travis " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Travis","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "tristan":
- _loc2_ = "Tristan Award";
- _loc3_ = "Wow Tristan " + AchievementsList.PARTNER_MATCH_NUM + " times.";
- _loc4_ = Profile.CurrentProfile.Achievements.getPairCounter("Tristan","TotalPerfectMatches") + " of " + AchievementsList.PARTNER_MATCH_NUM;
- break;
- case "wedding":
- _loc2_ = "Wedding Award";
- _loc3_ = "Get " + AchievementsList.OCCASION_MATCH_NUM + " good matches in a wedding level.";
- break;
- case "head turner":
- _loc2_ = "Head Turner Award";
- _loc3_ = "Impress any boyfriend.";
- break;
- case "total betty":
- _loc2_ = "Total Betty Award";
- _loc3_ = "Impress any boyfriend 20 times.";
- _loc4_ = Profile.CurrentProfile.Impress + " of 20";
- break;
- case "major hottie":
- _loc2_ = "Major Hottie Award";
- _loc3_ = "Impress any boyfriend 50 times.";
- _loc4_ = Profile.CurrentProfile.Impress + " of 50";
- break;
- case "fashionista":
- _loc2_ = "Fashionista Award";
- _loc3_ = "Score a \"C\" (C+, C or C-) average on 3 levels.";
- _loc4_ = Profile.CurrentProfile.Average_C + " of 3";
- break;
- case "trendsetter":
- _loc2_ = "Trendsetter Award";
- _loc3_ = "Score a \"B\" (B+, B or B-) average on 3 levels.";
- _loc4_ = Profile.CurrentProfile.Average_B + " of 3";
- break;
- case "fashion guru":
- _loc2_ = "Fashion Guru Award";
- _loc3_ = "Score an \"A\" (A+, A or A-) average on 3 levels.";
- _loc4_ = Profile.CurrentProfile.Average_A + " of 3";
- break;
- case "fashion queen":
- _loc2_ = "Fashion Queen Award";
- _loc3_ = "Score 15 \"A\" average levels.";
- _loc4_ = Profile.CurrentProfile.Average_A + " of 15";
- break;
- case "fashion goddess":
- _loc2_ = "Fashion Goddess Award";
- _loc3_ = "Score 25 \"A\" average levels.";
- _loc4_ = Profile.CurrentProfile.Average_A + " of 25";
- break;
- case "cutting edge":
- _loc2_ = "Cutting Edge Award";
- _loc3_ = "Score 5000 points on an outfit.";
- }
- _tfAwardName.text = _loc2_;
- _tfAwardDescription.text = _loc3_;
- if(Profile.CurrentProfile.isAchievementUnlocked(param1))
- {
- _tfAwardStatus.text = "ACHIEVED";
- }
- else if(_loc4_ == "")
- {
- _tfAwardStatus.text = "NOT YET ACHIEVED";
- }
- else
- {
- _tfAwardStatus.text = _loc4_;
- }
- }
-
- internal function showMedals(param1:int, param2:int) : void
- {
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- var _loc5_:MovieClip = null;
- var _loc6_:int = 0;
- var _loc7_:Number = NaN;
- cleanupMedals();
- _loc3_ = 0;
- while(_loc3_ < NUM_SLOTS)
- {
- _loc4_ = (param1 - CENTER_SLOT + _loc3_ + _iTotalMedals) % _iTotalMedals;
- _loc4_ = normalizeIndex(_loc4_ - 1) + 1;
- (_loc5_ = _aAchievements[_loc4_]).visible = true;
- if((_loc6_ = _loc3_ - param2) >= 0 && _loc6_ < NUM_SLOTS)
- {
- _loc5_.x = getSlot(_loc6_).x;
- _loc5_.y = getSlot(_loc6_).y;
- _loc5_.width = getSlot(_loc6_).width;
- _loc5_.height = getSlot(_loc6_).height;
- _loc7_ = 0.5;
- if(_loc3_ == CENTER_SLOT)
- {
- _loc7_ = 1;
- }
- Tweener.addTween(_loc5_,{
- "x":getSlot(_loc3_).x,
- "y":getSlot(_loc3_).y,
- "width":getSlot(_loc3_).width,
- "height":getSlot(_loc3_).height,
- "alpha":_loc7_,
- "time":MOVE_TIME
- });
- }
- else
- {
- _loc5_.x = getSlot(_loc3_).x;
- _loc5_.y = getSlot(_loc3_).y;
- _loc5_.width = getSlot(_loc3_).width;
- _loc5_.height = getSlot(_loc3_).height;
- }
- if(_loc3_ == CENTER_SLOT)
- {
- updateText(_loc5_.currentLabel);
- }
- _loc3_++;
- }
- }
-
- internal function normalizeIndex(param1:int) : int
- {
- while(param1 < 0)
- {
- param1 += _iTotalMedals;
- }
- while(param1 >= _iTotalMedals)
- {
- param1 -= _iTotalMedals;
- }
- return param1;
- }
- }
- }
-